//
//  Register.h
//  iCan - iPhone Context-Aware Navigation
//  Carnegie Mellon University - 18-842 Distributed Systems
//
//  Created by Andrew Santell on 3/26/12.
//  Copyright (c) 2012 Andrew Santell. All rights reserved.

#import <UIKit/UIKit.h>
#import "iCanAppDelegate.h"

@interface Register : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource, UITextFieldDelegate, NSStreamDelegate>
{
    NSString *message;
    NSInputStream *inputStream;
    NSOutputStream *outputStream;
    NSString *result;
    iCanAppDelegate *appDelegate;
}

@property (strong, nonatomic) IBOutlet UIPickerView *picker;
@property (weak, nonatomic) IBOutlet UITextField *userText;
@property (weak, nonatomic) IBOutlet UITextField *passText;
@property (weak, nonatomic) IBOutlet UITextField *firstText;
@property (weak, nonatomic) IBOutlet UITextField *lastText;
@property (weak, nonatomic) IBOutlet UITextField *groupText;
@property (strong, nonatomic) NSMutableArray *groupArray;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *home;

@property (retain, nonatomic) NSString *message;
@property (retain, nonatomic) NSInputStream *inputStream;
@property (retain, nonatomic) NSOutputStream *outputStream;
@property (retain, nonatomic) NSString *result;
@property (retain, nonatomic) iCanAppDelegate *appDelegate;


- (IBAction)register:(id)sender;
- (void) initNetworkCommunication;
- (void) stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent;
- (void) analyzeResult;

@end
